package com.softoa.serviceImp;

import com.softoa.mapper.PermissionMapper;
import com.softoa.pojo.Permission;
import com.softoa.service.IPermisssionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author LinKun
 * @date 2022-6-23 22:10
 */
@Service
public class PermissionServiceImp implements IPermisssionService {
    @Autowired
    PermissionMapper permissionMapper;

    @Override
    public List<Permission> permissionList() {
        Permission permission = new Permission();
        return permissionMapper.permissionListMultiple(permission);
    }

    @Override
    public List<Permission> userPermissionSelect(int i) {
        switch (i) {
            case 1:
                return permissionMapper.permissonEmployee();
            case 2:
                return permissionMapper.permissonManager();
            case 3:
                return permissionMapper.permissonSystem();
            default:
                return null;
        }
    }
}
